package cqrtplm.controller.thirdPartyAPI;

import cqrtplm.constant.RouteConstant;
import cqrtplm.dto.thirdPartyAPI.RestAdapterMomDTO;
import cqrtplm.dto.thirdPartyAPI.RestAdapterMomOrderDTO;
import cqrtplm.service.MomApiService;
import cqrtplm.vo.CrmApiResponseVO;
import cqrtplm.vo.MomApiResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: mom系统接口API入口
 * @author: zhengxiong.jiang
 * @createDate: 2025-10-23
 * @version: 1.0
 */
@RestController
@RequestMapping(RouteConstant.MOMAPI + "v1")
public class MomApiController {

    @Autowired
    private MomApiService momApiService;


    /**
     * 传递成品状态控制表至MOM系统接口
     * @param dto
     * @return
     */
    @PostMapping("/restInvoke")
    public MomApiResponseVO restInvoke(@RequestBody RestAdapterMomDTO dto) {
        return momApiService.restInvoke(dto);
    }

    /**
     * MOM订单接口查询
     * @param dto
     * @return
     */
    @PostMapping("/getOrder")
    public MomApiResponseVO getOrder(@RequestBody RestAdapterMomOrderDTO dto) {
        return momApiService.getOrder(dto);
    }

}
